Using Flex 4
ثبت نشده
چکیده
ProductAbstractFactory ConcreteProductConcreteFactoryAbstractClientManager ModuleApplication 145USING FLEX 4Application architecture Last updated 11/5/2010Module domainsBy default, a module is loaded into a child domain of the current application domain. You can specify a differentapplication domain by using the applicationDomain property of the ModuleLoader class. Because a module is loaded into a child domain, it owns class definitions that are not in the main application’s domain.For example, the first module to load the PopUpManager class becomes the owner of the PopUpManager class for theentire application because it registers the manager with the SingletonManager. If another module later tries to use thePopUpManager, Adobe ® Flash® Player throws an exception. The solution is to ensure that managers such as PopUpManager and DragManager and any other shared services aredefined by the main application (or loaded late into the shell’s application domain). When you promote one of thoseclasses to the shell, the class can then be used by all modules. Typically, this is done by adding the following to a scriptblock: import mx.managers.PopUpManager;import mx.managers.DragManager;private var popUpManager:PopUpManager;private var dragManager:DragManager; This technique also applies to components. The module that first uses the component owns that component’s classdefinition in its domain. As a result, if another module tries to use a component that has already been used by anothermodule, its definition will not match the existing definition. To avoid a mismatch of component definitions, create aninstance of the component in the main application. The result is that the definition of the component is owned by themain application and can be used by modules in any child domain. By default, modules do not share the main application’s StyleManager, however. They have their own instances of theIStyleManager2 class. As a result, modules can define their own styles. For example, style properties set on a Buttoncontrol in one module are not applied to the Button control in another module or to the main application. Because a module must be in the same security domain as the application (SWF) that loads it, when you’re usingmodules in an AIR application any module SWF must be located in the same directory as the main application SWFor one of its subdirectories, which ensures that like the main application SWF, the module SWF is in the AIRapplication security sandbox. One way to verify this is to ensure that a relative URL for the module’s location doesn’trequire "../" ("up one level") notation to navigate outside the application directory or one of its subdirectories. For more information about application domains, see “Developing and loading sub-applications” on page 179. Module applicationsTo create a modular application, you create separate classes for each module, and an application that loads themodules. Adobe® Flash® BuilderTM provides some mechanisms for making module use easier. Create a modular application1 Create any number of modules. An MXML-based module file’s root tag is . ActionScript-basedmodules extend either the Module or ModuleBase class.2 Compile each module as if it were an application. You can do this by using the mxmlc command-line compiler orthe compiler built into Adobe Flash Builder.3 Create an Application class. This is typically an MXML file whose root tag is , but it can also bean ActionScript-only application.4 In the Application file, use an tag to load each of the modules. You can also load modules byusing methods of the mx.modules.ModuleLoader and mx.modules.ModuleManager classes. 146USING FLEX 4Application architecture Last updated 11/5/2010Using styles with modulesWhen you set styles on modules, the style properties are set on the local StyleManager. Each module has its owninstance of the IStyleManager2 class. This means that each module can load its own set of styles, and its styles do notnecessarily affect the styles of other modules. After an application finishes loading a module, the module’s styles are merged with the styles of the application. Themodule’s StyleManager walks the chain of parent modules and applications, up to the top-level StyleManager, andmerges its styles with those set on the StyleManagers above it. If during a style merge, a module encounters a style that it already sets on itself, the style is ignored. If the moduleencounters a style not set on itself, the style is added to the merged style definition. The styles set on the StyleManagerthat is closest to the module wins. The following example loads two modules. The main application sets the color and cornerRadius style propertieson the Button control type selector. The modules each set the color property on the Button control type selector. Themerged styles result in the Buttons having a corner radius of 10, with colors set by each module. This shows how stylemerges work. xmlns:fx="http://ns.adobe.com/mxml/2009"xmlns:s="library://ns.adobe.com/flex/spark"xmlns:mx="library://ns.adobe.com/flex/mx">@namespace s "library://ns.adobe.com/flex/spark";s|Button {color:blue;cornerRadius:10;}
منابع مشابه
مقایسه آزمایشگاهی کارایی روشهای چرخشی Profile، Protaper، Flex Master و دستی NiTi K-File در آمادهسازی کانال ریشه
Statement of Problem: Root canal cleaning and shaping are important steps in endodontic therapy. In order to develop better techniques, new instruments are constantly designed and delivered to the market.Purpose: The aim of the present study was to compare the effectiveness of one manual with three rotary root canal instrumentations techniques.Materials and Methods: In this in-vitro study, 80 m...
متن کاملOrthogonal Graph Drawing with Inflexible Edges
We consider the problem of creating plane orthogonal drawings of 4-planar graphs (planar graphs with maximum degree 4) with constraints on the number of bends per edge. More precisely, we have a flexibility function assigning to each edge e a natural number flex(e), its flexibility. The problem FLEXDRAW asks whether there exists an orthogonal drawing such that each edge e has at most flex(e) be...
متن کاملFacet-sparing lumbar decompression with a minimally invasive flexible MicroBlade Shaver® versus traditional decompression: quantitative radiographic assessment
BACKGROUND Laminectomy/laminotomy and foraminotomy are well established surgical techniques for treatment of symptomatic lumbar spinal stenosis. However, these procedures have significant limitations, including limited access to lateral and foraminal compression and postoperative instability. The purpose of this cadaver study was to compare bone, ligament, and soft tissue morphology following l...
متن کاملThe Columbus Knee System: 4-Year Results of a New Deep Flexion Design Compared to the NexGen Full Flex Implant
The Columbus knee system is designed as a standard knee implant to allow high flexion without additional bone resection. Between August, 2004 and March, 2010 we performed 109 total knee arthroplasties of the Columbus knee system in 101 consecutive patients suffering from primary arthrosis of the knee. Mean age was 72.4 years in women and 70.3 years in men. Mean followup was 47.3 months. The 4-y...
متن کاملFLEX: the first light explorer. A fully OH-suppressed near-infrared integral field spectrograph
FLEX is a concept for a fully OH suppressed near infrared integral field spectrograph, being developed at the AAO. FLEX will be the first instrument to employ fibre Bragg gratings for OH suppression, a radical new technology which cleanly suppresses the atmospheric OH emission lines at 30dB whilst maintaining a high overall throughout of ~90%. In this paper we simulate the expected performance ...
متن کاملشبیه سازی رواناب در حوضه بالادست هلمند افغانستان با استفاده از واسنجی چندهدفه و مدل مفهومی FLEX
رودخانه هیرمند اصلیترین زهکش نیمه جنوبی افغانستان بوده و تأثیر به سزایی در حیات اقتصادی- اجتماعی منطقه سیستان دارد. در راستای ارزیابی پتانسیل آبی رودخانه هیرمند در طولانی مدت نیاز به استفاده از مدل بارش رواناب می باشد. هدف از این تحقیق شبیهسازی رواناب روزانه حوضه بالادست هلمند با استفاده از مدل مفهومی FLEX در ترکیب با بهینهسازی چندهدفه بوده که در سایر تحقیقات پیشین مورد توجه نبوده است. بنا...
متن کامل